// 整个脚本记为宏1
Promise.resolve().then(() => {    // 微1
    console.log('promise1');
    const timer2 = setTimeout(() => {   // 宏3
        console.log('timer2');
    }, 0);
});

const timer1 = setTimeout(() => {  // 宏2
    console.log('timer1');  
    Promise.resolve().then(() => {  // 微2
        console.log('promise2');
    })
}, 0);

console.log('start');   // 宏1 同步代码

// start -> promise1 -> timer1 -> promise2 -> timer2